Repository navigation
kueue: Add queue maintenance mode controls and drain actions - #1252
abhayrajjais01 wants to merge 1 commit into
Conversation
af1fabe to
6fbc27d
Compare
Ralthos
left a comment
There was a problem hiding this comment.
This closes a real gap: spec.stopPolicy is read-only on the LocalQueue page today. The
drain confirmation is the right call.
No access check on the controls
QueueMaintenanceControl goes into extraSections unconditionally, under the
KueueAdminResourceAccess that checks verb="get". A read-only user sees
Drain Queue (HoldAndDrain), confirms, and gets a 403. AuthVisible with authVerb="patch"
would hide the buttons.
LocalQueue also needs a namespace there, or the check asks about patching cluster-wide and
refuses anyone holding the permission through a RoleBinding. That is #1199 again.
cohortName breaks the empty case
- value: renderCohortLink(clusterQueue.spec.cohortName),
+ value: renderCohortLink(clusterQueue.cohortName),The getter returns this.spec.cohortName || '-', and renderCohortLink guards on
if (!cohortName). Since '-' is truthy, a ClusterQueue with no cohort now renders a link to a
cohort named -. Looks unrelated to the feature, so possibly accidental.
Six strings never reach the catalog
t(getStopPolicyLabel(...)) builds the key at runtime and i18next-parser extracts statically,
so the three labels and three descriptions are absent from translation.json. The parser needs
the literals at the t() call site.
The i18n array is empty
"headlamp": { "i18n": [] } lists no locales, so the locales/en/translation.json added here
may never load. prometheus lists 19, flux lists ["en"].
6fbc27d to
1f76e91
Compare
Hi @Ralthos , Thanks for the great feedback! have updated the PR with all your suggestions: Permission Check: Wrapped the buttons in happy to make any further changes if needed |
|
All four landed cleanly. Thanks for turning it around so fast. The buttons sit inside Cohort reads Labels and descriptions are literals at the Formatter tests pass here and |
1f76e91 to
48fb378
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Default ClusterQueue state handling and named-resource authorization checks are currently incorrect.
1 open finding
What changed in this PR
Adds maintenance-mode controls for Kueue ClusterQueues and LocalQueues.
Changes:
- Adds pause, drain, resume, authorization, confirmation, and error handling.
- Adds stop-policy formatting, localization, and unit tests.
- Prevents placeholder cohort links.
| File | Description |
|---|---|
kueue/src/resources/queueControlFormatters.ts |
Adds stop-policy helpers. |
kueue/src/resources/queueControlFormatters.test.ts |
Tests formatter behavior. |
kueue/src/components/common/QueueMaintenanceControl.tsx |
Implements maintenance controls. |
kueue/src/components/clusterqueues/Detail.tsx |
Integrates ClusterQueue controls. |
kueue/src/components/localqueues/Detail.tsx |
Integrates LocalQueue controls. |
kueue/src/components/common/KueueResourceLinks.tsx |
Avoids placeholder cohort links. |
kueue/package.json |
Enables English localization. |
kueue/locales/en/translation.json |
Adds maintenance UI strings. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
illume
left a comment
There was a problem hiding this comment.
Thanks for working on this.
Would you mind addressing the open Copilot review comments? Please mark each comment as resolved after addressing it.
b1809d8 to
f095dcc
Compare
illume
left a comment
There was a problem hiding this comment.
Thanks for this PR.
The open review comments from Copilot still need attention — can you have a look? Once addressed, please mark them as resolved.
f095dcc to
05db3d4
Compare
05db3d4 to
c369e64
Compare
illume
left a comment
There was a problem hiding this comment.
Thanks for these changes.
Can you please address the open review comments? Once you've resolved each one, please mark it as resolved.
c369e64 to
2ba4b8b
Compare
|
@illume, thank you, looking forward for your feedback |
illume
left a comment
There was a problem hiding this comment.
Thanks for these changes.
Can you please address the open review comments? Once you've resolved each one, please mark it as resolved.
Implement QueueMaintenanceControl card with AuthVisible RBAC checks, stopPolicy formatters, type-only imports, targeted action loading states, and drain confirmation modal. Signed-off-by: Abhayraj Jaiswal <abhayraj916146@gmail.com>
2ba4b8b to
52ff329
Compare


Description
This PR introduces interactive Queue Maintenance Mode controls (
HoldAndDrain,Hold, andNoneresume) forClusterQueueandLocalQueueresources in the Headlamp Kueue plugin.In Kueue, cluster operators manage queue availability and maintenance via
spec.stopPolicy. When taking nodes offline or performing cluster maintenance, operators need direct controls in Headlamp to:Hold): Safely pauses new workload admissions while allowing running workloads to complete normally.HoldAndDrain): Pauses new admissions and evicts currently admitted workloads (with safety confirmation dialog).None): Re-enables normal workload admission.What Changes
src/resources/queueControlFormatters.ts):getStopPolicyColor,getStopPolicyLabel, andgetStopPolicyDescriptionto provide color-coded chips and operational explanations.createStopPolicyPatchfor standard Kubernetesspec.stopPolicypatch mutations.src/components/common/QueueMaintenanceControl.tsx):QueueMaintenanceControl: Renders maintenance status badge with color coding (Green:Active, Orange:Paused (Hold), Red:Drain (HoldAndDrain)).HoldAndDrainactions explaining that in-flight workloads will be evicted.QueueMaintenanceControlintoClusterQueueDetailandLocalQueueDetailviews.src/resources/queueControlFormatters.test.ts):